package com.glr.common.utils;

/**
 * 结果统一处理
 *
 * @author GLoRy
 * @date 2021/6/1 11:05
 */
@SuppressWarnings("all")
public class ResultUtils {

    /**
     * 是否成功
     */
    private boolean flag;
    /**
     * 返回状态--》自定义
     */
    private Enum<?> code;
    /**
     * 返回消息
     */
    private String message;
    /**
     * 返回数据
     */
    private Object data;
    /**
     * 返回session数据
     */
    private String httpSession;

    public ResultUtils(boolean flag, Enum<?> code, String message, Object data) {
        this.flag = flag;
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public ResultUtils(boolean flag, Enum<?> code, String message, String httpSession) {
        this.flag = flag;
        this.code = code;
        this.message = message;
        this.httpSession = httpSession;
    }

    public ResultUtils(boolean flag, Enum<?> code, String message) {
        this.flag = flag;
        this.code = code;
        this.message = message;
    }

    public boolean isFlag() {
        return flag;
    }

    public void setFlag(boolean flag) {
        this.flag = flag;
    }

    public Enum<?> getCode() {
        return code;
    }

    public void setCode(Enum<?> code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public String getHttpSession() {
        return httpSession;
    }

    public void setHttpSession(String httpSession) {
        this.httpSession = httpSession;
    }
}
